import Vue from 'vue'
import request from '@/itsoftUI/utils/request'
import qs from "qs"
const baseUrl = Vue.prototype.$itsoftUI.config.serviceUrl + "/manager"
const tableformUrl = Vue.prototype.$itsoftUI.config.serviceUrl + "/tableform"

const indexApi = {
    //公寓校验请求数据合法性
    checkUserRole: function (id) {
        const data = {
            id
        }
        return request({
            url: tableformUrl + "/flowApply/checkUserRole",
            method: "post",
            data: qs.stringify(data)
        })
    },
    //最近浏览
    applicationRecentList: function () {
        const data = {

        };
        return request({
            url: baseUrl + "/personalApplicationRecent/list",
            method: "post",
            data: qs.stringify(data)
        });
    },
    Save: function (data) {
        const config = {
            headers: {
                'Content-Type': 'application/json;charset=utf-8'
            },
        }
        return request.post(baseUrl + "/personalApplicationRecent/save", data, config)
    },
    //应用
    personalApplicationList: function (type, search, systemCode) {
        const data = {
            type,
            search,
            systemCode

        };
        return request({
            url: baseUrl + "/systemPersonalApplication/getListByType",
            method: "post",
            data: qs.stringify(data)
        });
    },
    //待办
    systemPersonalWaitList: function (size) {
        const data = {
            size
        };
        return request({
            url: baseUrl + "/systemPersonalWait/list",
            method: "post",
            data: qs.stringify(data)
        });
    },
    //消息
    listMessage: function (pageIndex, pageSize, appName, content) {
        const data = {
            pageIndex,
            pageSize,
            appName,
            content
        };
        return request({
            url: baseUrl + "/systemPersonalWait/listMessage",
            method: "post",
            data: qs.stringify(data)
        });
    },
    getAllByUserId: function () {
        const data = {

        };
        return request({
            url: baseUrl + "/content/getAllByUserId",
            method: "post",
            data: qs.stringify(data)
        });
    },
    //获取登录人信息
    getLoginUserInfo: function () {
        const data = {};
        return request({
            url: baseUrl + "/selectionApplyInfo/getLoginUserInfo",
            method: "post",
            data: qs.stringify(data)
        });
    },
    //查询是否申请过此批次
    getIsThisBatchHasSelected: function (account, batchId) {
        const data = {
            account,
            batchId
        };
        return request({
            url: baseUrl + "/selectionBatch/isThisBatchHasSelected",
            method: "post",
            data: qs.stringify(data)
        });
    },
    systemList: function () {
        const data = {

        };
        return request({
            url: Vue.prototype.$itsoftUI.config.serviceUrl + '/auth/user/systemBaseinfoList',
            method: 'post',
            data: qs.stringify(data)
        })

    },
}
export {
    indexApi
}